/* sovrn_stndalne_beacon v0.0.1 Updated : 2023-07-31 */ window.sovrn=window.sovrn||{},sovrn.auction=sovrn.auction||{};let beaconFlag=!1,cmpVersion=0;sovrn.auction={doNotTrack:function(n,t){n=n||navigator,t=t||window;var e=sovrn.auction.readCookie("tracking_optout");return"yes"===n.doNotTrack||"1"===n.doNotTrack||"1"===n.msDoNotTrack||"1"===t.doNotTrack||"1"===e},readCookie:function(n){for(var t=n+"=",e=document.cookie.split(";"),o=0;o=0;t--)if(o.test(n[t].src))return n[t];return null},createiFrame:function(n,t,e){var o,a,r,c,i,s;for(r in a=(o=document.createElement("iframe")).style,s={margin:"0px",padding:"0px",border:"0px none",width:t+"px",height:e+"px",overflow:"hidden"},i={id:n,margin:"0",padding:"0",frameborder:"0",width:t+"",height:e+"",scrolling:"no",src:"about:blank"})i.hasOwnProperty(r)&&o.setAttribute(r,i[r]);for(c in s)if(s.hasOwnProperty(c))try{a[c]=s[c]}catch(n){}return o},getBeaconURL:function(){return"https://ce.lijit.com/beacon?informer="+(sovrn.auction.beaconConfig.hasOwnProperty("iid")?sovrn.auction.beaconConfig.iid:"")+"&gdpr_consent="+(sovrn.auction.gdprConsent||"")+"&us_privacy="+(sovrn.auction.ccpaConsent||"")+"&gpp="+(sovrn.auction.gppConsent||"")+"&gpp_sid="+(sovrn.auction.gppSid||"")},sovrnReady:function(n){/in/.test(document.readyState)?setTimeout((function(){sovrn.auction.sovrnReady(n)}),50):n()},configureConsents:function(){const n=this;n.lookupIabConsent((function(t){sovrn.auction.gdprConsent=1===cmpVersion?t.getConsentData.consentData:t.tcString,n.configureCcpa()}),(function(t){n.configureCcpa()}))},configureCcpa:function(){const n=this;this.lookupCcpaConsent((function(t){sovrn.auction.ccpaConsent=t.uspData,n.configureGpp()}),(function(t){n.configureGpp()}))},configureGpp:function(){const n=this;this.lookupIabConsentForGpp((function(t){sovrn.auction.gppConsent=t.gppString,sovrn.auction.gppSid=t.applicableSections,n.sendBeacon()}),(function(t){n.sendBeacon()}))},callCmpFromSafeframe:function(n,t,e,o){window.$sf.ext.register(1,1,(function(n,a){"cmpReturn"===n?e(a[t]):o()})),window.$sf.ext.cmp(n)},cmpCallbacks:{},callCmpWhileInIframe:function(n,t,e,o){const a=2===cmpVersion?"__tcfapi":"__cmp",r=Math.random().toString(),c=`${a}Call`,i={[c]:{command:n,parameter:null,callId:r}};1!==cmpVersion&&(i[c].version=cmpVersion),sovrn.auction.cmpCallbacks[r]=e,t.postMessage(i,"*"),window.addEventListener("message",(function(n){const t=`${a}Return`;let e={};try{e="string"==typeof n.data?JSON.parse(n.data):n.data}catch(n){}if(e[t]&&e[t].callId){const n=e[t];"function"==typeof sovrn.auction.cmpCallbacks[n.callId]?sovrn.auction.cmpCallbacks[n.callId](n.returnValue,n.success):o("Callback must be function type.")}}),!1)},lookupIabConsent:function(n,t){function e(e,o){o&&"string"==typeof e.tcString?"tcloaded"===e.eventStatus||"useractioncomplete"===e.eventStatus||"cmpuishown"===e.eventStatus&&e.tcString.length>0&&!0===e.purposeOneTreatment?n(e):t("Consent string is not available."):t("CMP unable to register callback function. Please check CMP setup.")}const o=function(){const e={};function o(){e.getConsentData&&e.getVendorConsents?n(e):!e.hasOwnProperty("getConsentData")||!e.hasOwnProperty("getVendorConsents")||e.getConsentData&&e.getVendorConsents||t("Consent string is blank.")}return{consentDataCallback:function(n){e.getConsentData=n,o()},vendorConsentsCallback:function(n){e.getVendorConsents=n,o()}}}(),{cmpFrame:a,cmpFunction:r}=function(){let n,t,e=window;for(;!n;){try{if("function"==typeof e.__tcfapi||"function"==typeof e.__cmp){"function"==typeof e.__tcfapi?(cmpVersion=2,t=e.__tcfapi):(cmpVersion=1,t=e.__cmp),n=e;break}}catch(n){}try{if(e.frames.__tcfapiLocator){cmpVersion=2,n=e;break}}catch(n){}try{if(e.frames.__cmpLocator){cmpVersion=1,n=e;break}}catch(n){}if(e===window.top)break;e=e.parent}return{cmpFrame:n,cmpFunction:t}}();if(!a)return t("CMP not found.");"function"==typeof r?1===cmpVersion?(r("getConsentData",null,o.consentDataCallback),r("getVendorConsents",null,o.vendorConsentsCallback)):2===cmpVersion&&r("addEventListener",cmpVersion,e):1===cmpVersion&&window.$sf&&window.$sf.ext&&"function"==typeof window.$sf.ext.cmp?(this.callCmpFromSafeframe("getConsentData",o.consentDataCallback,t),this.callCmpFromSafeframe("getVendorConsents",o.vendorConsentsCallback,t)):1===cmpVersion?(this.callCmpWhileInIframe("getConsentData",a,o.consentDataCallback,t),this.callCmpWhileInIframe("getVendorConsents",a,o.vendorConsentsCallback,t)):2===cmpVersion&&this.callCmpWhileInIframe("addEventListener",a,e,t)},lookupCcpaConsent:function(n,t){var e,o="getUSPData",a={uspData:"",success:!1};try{e=window.__uspapi||window.top.__uspapi}catch(n){t(n)}if("function"==typeof e)e(o,1,(function(e,o){a.uspData=e&&e.uspString||"",a.success=o,o?n(a):t()}));else{for(var r,c=window,i=(new Date).getTime();!r;){try{c.frames.__uspapiLocator&&(r=c)}catch(n){return void t(n)}if(c===window.top)return void t();c=c.parent}var s={__uspapiCall:{command:o,version:1,parameter:null,callId:i}};r.postMessage(s,"*"),window.addEventListener("message",(function(e){e.data&&e.data.__uspapiReturn&&e.data.__uspapiReturn.callId===i&&(e.data.__uspapiReturn.success?n(e.data.__uspapiReturn.returnValue):t())}),!1)}},cmpClient:function({apiName:n,apiVersion:t,apiArgs:e=["command","callback","parameter","version"],callbackArgs:o=["returnValue","success"]},a=window){const r={},c=`${n}Call`,i=`${n}Return`;const[s,p]=function(){let t,e=a,o=!1;for(;null!=e;){try{if("function"==typeof e[n]){t=e,o=!0;break}}catch(n){}try{if(e.frames[`${n}Locator`]){t=e;break}}catch(n){}if(e===a.top)break;e=e.parent}return[t,o]}();if(!s)return;function u(n){return n=Object.assign({version:t},n),e.map((t=>[t,n[t]]))}function l(n,t,e,o){return function(a,r){o&&o();const c=null==r||r?t:e;if("function"==typeof n)return c(),n.apply(this,arguments);c(a)}}let f;return p?f=function(t={}){return new Promise(((e,o)=>{const a=s[n](...u({...t,callback:t.callback&&l(t.callback,e,o)}).map((([n,t])=>t)));null==t.callback&&e(a)}))}:(a.addEventListener("message",(function(n){const t="string"==typeof n.data&&n.data.includes(i)?JSON.parse(n.data):n.data;if(t?.[i]?.callId){const n=t[i];r.hasOwnProperty(n.callId)&&r[n.callId](...o.map((t=>n[t])))}}),!1),f=function(n){return new Promise(((t,e)=>{const o=Math.random().toString(),a={[c]:{...Object.fromEntries(u(n).filter((([n])=>"callback"!==n))),callId:o}};r[o]=l(n?.callback,t,e,null==n?.callback&&(()=>{delete r[o]})),s.postMessage(a,"*")}))}),f.isDirect=p,f},lookupIabConsentForGpp:function(n,t){const e=this.cmpClient({apiName:"__gpp",apiVersion:1});if(!e)return t("GPP CMP not found.");e({command:"addEventListener",callback:function(o){o&&("sectionChange"===o.eventName||"loaded"===o.pingData.cmpStatus?e({command:"getGPPData"}).then((o=>Promise.all((o?.pingData?.supportedAPIs||[]).map((n=>e({command:"getSection",parameter:n}).catch((()=>{})).then((t=>[n,t]))))).then((e=>{const a=Object.fromEntries(e.filter((([n,t])=>null!=t)));!function(n,{onSuccess:t,onError:e}){function o(){const t=n?.gppData?.gppString,e=n?.gppData?.applicableSections;return!(Array.isArray(e)&&(!Array.isArray(e)||t&&(o=t,"[object String]"===Object.prototype.toString.call(o))));var o}o()?e("CMP returned unexpected value during lookup process.",n):t(function({gppData:n,sectionData:t}={}){let e={gppString:n?n.gppString:void 0,gppData:n||void 0};return e.applicableSections=function(n){return n&&Array.isArray(n.applicableSections)&&n.applicableSections.length>0&&0!==n.applicableSections[0]?n.applicableSections:[]}(n),e.apiVersion=1,e.sectionData=t,e}(n))}({gppData:o,sectionData:a},{onSuccess:n,onError:t})})))):"error"===o.pingData.cmpStatus&&t("CMP returned with a cmpStatus:error response. Check CMP setup."))}})}},sovrn.auction.sovrnReady((function(){!1===sovrn.auction.doNotTrack()&&sovrn.auction.configureConsents()}));